export default class {
    #state="pending";
    #result=undefined;
    constructor(executor) {
        try{
            // 同步调用执行器函数
            executor(function(value){
                this.#state = "fulfilled";
                this.#result = value;
            }.bind(this),function(value){
                this.#state = "rejected";
                this.#result = value;
            }.bind(this));
        }catch (err){
            this.#state = "rejected";
            this.#result = err;
        }


    }
};